(SST) ShlWAPI.pas Version 1.08

Developer Reference
PERCEIVEDFLAG Type Definition
Definition for an unsigned 32-bit integer that is synonymous with the Windows, API DWORD type.
Scope
Global (i.e. variables of this type can be declared in any unit that uses/includes the unit in which it is defined/declared).
Syntax
TYPE PERCEIVEDFLAG = DWORD;
Values
A variable of this type accepts a single 32-bit (4 byte), signed, integer value in the range from 0 up to (and including) 4,294,967,295 (= $FFFF FFFF). However, typically it is used to store one or a combination of the following constants.
Constant/Symbolic Name Value Description
PERCEIVEDFLAG_UNDEFINED $0000 The function was unable to determine a source of intormation on the perceived type for the specified file suffix/extension. Support for this particular suffix/extenison is therefore undefined.
PERCEIVEDFLAG_SOFTCODED $0001 The type as which this file suffix/extension is perceived was resolved by reading the pertinent entries in the Windows registry.
PERCEIVEDFLAG_HARDCODED $0002 This file suffix/extension is known to the operating system because it is hard-coded in one of the core system's executables (i.e. the system does not require information stored in files with variable content, such as registry, .ini. or .conf, files, to recognize the extension). This bit-flag is frequently encountered in combination with the PERCEIVEDFLAG_NATIVESUPPORT flag.
PERCEIVEDFLAG_NATIVESUPPORT $0004 Support for files of this type is built into the operating system. This bit-flag is frequently encountered in combination with the PERCEIVEDFLAG_HARDCODED flag.
PERCEIVEDFLAG_GDIPLUS $0010 Support for files of this type is provided through and requires the GDI+ dynamic link library (dll) (Gdiplus.dll). The file type is known because this module was either installed together with the operating system or as part of an update.
PERCEIVEDFLAG_WMSDK $0020 The suffix/extension is recognized and supported by the Windows Media Format SDK modules.
PERCEIVEDFLAG_ZIPFOLDER $0040 This file extension was recognized as belonging to a compressed file (e.g. .cab, .zip) type. Support for this file type may be an inherent part of the operating system or provided through third party software. The source for the perception of the file type therefore depends on the specific extension, operating system version, and the installed (third party) software. In this context it should be noted that, even though operating system support for .zip files was (only) introduced with Windows XP, the NT file system (NTFS) has supported compressed files/folders ever since the advent of Windows NT 3.51, even if this was restricted to files compressed with the Lempel-Ziv algorithm (i.e. .cab files).
Remarks
This data type is used primarily in calls to the ShlWAPI.dll function AssocGetPerceivedType.
A combination of the above values is specified by combining them through a bit-wise "OR", as in the following code snippets.
Example:
...
var combinedflags : PERCEIVEDFLAG;
...
combinedflags := PERCEIVEDFLAG_HARDCODED OR PERCEIVEDFLAG_NATIVESUPPORT; // = $0002 OR $0004 = $0006
...
combinedflags := combinedflags OR PERCEIVEDFLAG_ZIPFOLDER; // = $0006 OR $0040 = $0046
...
//Alternatively, the following line would produce the same result
combinedflags := PERCEIVEDFLAG_HARDCODED OR PERCEIVEDFLAG_NATIVESUPPORT OR PERCEIVEDFLAG_ZIPFOLDER; // = $0046
To subsequently test a variable for a particular flag/value:
...
var combinedflags : PERCEIVEDFLAG;
...
IF (combinedflags AND PERCEIVEDFLAG_ZIPFOLDER) <> 0 THEN
ShowMessage('A compressed file');
Example
For an example that uses this type definition, please refer to the description of the AssocGetPerceivedType function.
Requirements
Unit Declared in ShlWAPI.pas
Library ShlWAPI.dcu/ShlWAPI.obj
See Also
AssocGetPerceivedType, PERCEIVED
 
Windows APIs: AssocGetPerceivedType. PERCEIVED, PERCEIVEDFLAG.

Document/Contents version 1.00
Page/URI last updated on 07.12.2023
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com